package com.lingnan.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

/**
 * 注意：这里的拦截的服务是远程服务，即对远程服务进行添加token所以在内部服务是没有携带token
 */

//@Configuration
//public class XTokenRequestInterceptor implements RequestInterceptor {
//    @Override
//    public void apply(RequestTemplate template) {
//        String token = UUID.randomUUID().toString();
//        System.out.println("生成的X-Token: " + token);
//        template.header("X-Token", token); // 注意这里是大写X-Token
//    }
//}